﻿----------------------------------------------------------------------------------------------------
--
--  © 2012 Stanislav S. Yarmonov.
--
--  TODO:LICENSE
--     
----------------------------------------------------------------------------------------------------
EXECUTE [_DB].[Procedure_Drop]
	@@Name = '[_DB].[View_Drop]'
GO

----------------------------------------------------------------------------------------------------
--
--  View dropping routine.
--
--  INPUT
--		@@Name
--		Name of the view to be dropped.
--
----------------------------------------------------------------------------------------------------
CREATE PROCEDURE [_DB].[View_Drop]
	@@Name [sysname]
AS
SET NOCOUNT ON

IF [_DB].[View_Exists](@@Name) = 1
BEGIN
	DECLARE @SQL [nvarchar](max) SELECT @SQL =
		N'DROP VIEW ' + @@Name

	EXECUTE(@SQL)
END

RETURN 0
GO
